#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework4_9.py
# author:wmf
# datetime:2021/4/12 20:35
# software: PyCharm
'''
this is function description
'''
# import module your need

# 9 从网络上下载一张图片，保存到计算机的指定目录；（requests和os模块）


import requests,os

path = os.getcwd()

url = "https://aecpm.alicdn.com/simba/img/TB1XotJXQfb_uJkSnhJSuvdDVXa.jpg"

r = requests.get(url)
r.raise_for_status()

# path = os.path.join(path,url.split('/')[-1])

print(path)
with open('1.jpg','wb') as f:
    f.write(r.content)
    print("保存成功")
